<?php

class Default_Model_Newscat extends Zend_Db_Table_Abstract{
    public $_name="news_cat";            
    public function getAllData(){
		$query = $this->select()
                        ->setIntegrityCheck(false)
                        ->from(array('c'=>$this->_name),array('c.catId','c.catCode','c.catName','c.ord','c.shortName','c.display','c.highlight'))
                        ->where('c.display = 1')
                        ->order('c.ord asc'); 
        return $this->fetchAll($query);
    }    
    public function getWhere($id){
        $se=$this->select();
        $se->where("id=$id");        
        if($kq=$this->fetchRow($se))
            return $kq->toArray();
        else
            return false;  
    }
    
    public function updateCat($data,$id){
        $this->update($data,"id=$id");          
    }
}